<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>登录页面</title>
<style type="text/css">
*{
font-family:Tahoma;
font-size:12px;
color:#333;
}
.login-wrapper {
	position:absolute;
	width:100%;
	background: url('component/loginPanel/1login/logintop.png') top left repeat-x;
	left: 0px;
	top: 0px;
	}

.login-top {
	width: 100%;
	padding: 85px 0 60px 0;
	text-align: center;
	font-size:22px;
	font-family:"微软雅黑";
	color:#DDEEFF;
	}
.blank {
	margin-left:auto;
	margin-right:auto;
	width:753px;
	height:230px;
	}
.scene {
	margin-left:auto;
	margin-right:auto;
	width:753px;
	height:230px;
	background-image:url(component/loginPanel/1login/sceneborder.png);
	}
.scenepic {
	position:relative;
	float:left;
	left:21px;
	top:16px;
	width:457px;
	height:191px;
	z-index:2;
	background-image:url(component/loginPanel/1login/4.jpg);
}
.footer{
	position:absolute;
	width:95%;
	bottom:35px;
	text-align:center;
	color:#666;
	font-size:14px;
}
.login{
	margin-left:auto;
	margin-right:auto;
	margin-top:-160px;
	width:753px;
	height:230px;
}
.listObj{
	position:relative;
	float:right;
	padding-right:45px;
	font-size:12px;
}
.loadingObj{
	position:relative;
	float:right;
	padding-right:25px;
	font-size:12px;
}
.login input{
	height:12px;
	width:120px;
}
.login button{
	height:25px;
	margin-left:60px;
}
</style>
<script type="text/javascript" src="<%=basePath%>component/jquery/jquery.min.js"></script>
    <!-- login validate dwr  -->    
    <script type="text/javascript" src="<%=basePath%>dwrsystem/engine.js"></script>
	<script type="text/javascript" src="<%=basePath%>dwrsystem/interface/validateLogin.js"></script>
	<script type="text/javascript">
	function validaterForm(){
		loadingForm();
		var usernameValue = $("#username").val();
		var passwordValue = $("#password").val();
		if($.trim(usernameValue)==''){enterFrom();alert('请填写用户名');document.getElementById("username").focus();return ;}
		if($.trim(passwordValue)==''){enterFrom();alert('请填写密码');document.getElementById("password").focus();return ;}
		validateLogin.validate(usernameValue,passwordValue,'<%=request.getRemoteAddr()%>',
			function(data){
				if(data == 0){
					enterFrom();
					alert('用户名或者密码错误');
					return false;
				}else if(data == -1){
					enterFrom();
					alert('登陆工作站地址不正确');
					return false;
				}else{
					document.forms[0].submit();
				}
			});
	}
	
	function enterFrom(){
		document.getElementById('loginForm').style.display = '';
		document.getElementById('loading').style.display = 'none';
	}
	function loadingForm(){
		document.getElementById('loginForm').style.display = 'none';
		document.getElementById('loading').style.display = '';		
	}
	
	$(function (){
		document.getElementById("username").focus();
		$("#username").keydown(function(event){if(event.keyCode==13){validaterForm(); }});
		$("#password").keydown(function(event){if(event.keyCode==13){validaterForm(); }});  
		$("#submitForm").keydown(function(event){if(event.keyCode==13){validaterForm(); }});
	});
	</script>
</head>

<body style="background-image:url(component/loginPanel/1login/Loginbg.jpg);">
		<div class="login-wrapper">
			<div class="login-top">
			电子政务办公平台
			</div>
		</div>
	<div class="blank">
	</div>
	<div class="scene">
		<div class="scenepic">
		</div>    
	</div>
	<div class="login">
		<div id="loginForm" class="listObj">
		<form class="clearfix" action="<%=basePath%>system/LoginAction!login.action" method="post">
		<table>
			<tr><th>用户名</th><td><input class="field" type="text" name="username" id="username" value="" maxlength="20" size="23" /><span style="color:red">*</span></td></tr>
			<tr><th>密&nbsp;码</th><td><input class="field" type="password" name="password" id="password" maxlength="20" size="23" /><span style="color:red">*</span></td></tr>
			<tr><th></th><td><button type="button" id="submitForm" name="submitForm" class="bt_login"  onclick="javascript:validaterForm()">登录系统</button></td></tr>
		</table>
		</form>
		</div>
		<div id="loading" class="loadingObj" style="display:none;">
			<img height="51" width="243" id="loadingImg" src="theme/images/progress.gif" />
		</div>
	</div>
	<div class="footer">中科软科技股份有限公司 CO.Ltd</div>
</body>
</html>
